package com.wyy.web;

import com.wyy.pojo.AppreciatesOrder;
import com.wyy.pojo.Users;
import com.wyy.pojo.model.UserModel;
import com.wyy.pojo.model.UserToken;
import com.wyy.response.CommonReturnType;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @program: gytcb
 * @author: 吴磊
 * @create: 2021-06-28 15:31
 */
@Component
public class UserFeignActionFallBack implements UserFeignAction {
    /**
     * 根据用户名称模糊查询用户
     *
     * @param userToken
     * @return
     */
    @Override
    public CommonReturnType getUserByNameLike(UserToken userToken) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 检查订单支付状态
     *
     * @param appreciatesOrder
     * @return
     */
    @Override
    public CommonReturnType checkOrderStatus(AppreciatesOrder appreciatesOrder) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 获取支付二维码
     *
     * @param appreciatesOrder
     * @return
     * @throws Exception
     */
    @Override
    public CommonReturnType FacetoFacePay(AppreciatesOrder appreciatesOrder) throws Exception {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 异步回调接口
     *
     * @param mapParams
     * @return
     * @throws Exception
     */
    @Override
    public String notifyInterface(Map<String, String> mapParams) throws Exception {
        return null;
    }

    /**
     * 检查用户是否登录
     *
     * @return
     */
    @Override
    public CommonReturnType checkUserIsLogin() {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 获取所有的用户
     *
     * @return
     */
    @Override
    public CommonReturnType getAllUser() {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 用户登录接口
     *
     * @param userModel
     * @return
     */
    @Override
    public CommonReturnType login(UserModel userModel) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 验证用户名是否存在
     *
     * @param userNickName
     * @return
     */
    @Override
    public CommonReturnType getUserByUserNickname(String userNickName) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 验证邮箱是否存在
     *
     * @param userEmail
     * @return
     */
    @Override
    public CommonReturnType getUserByUserEmail(String userEmail) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 用户注册接口
     *
     * @param users
     * @return
     */
    @Override
    public CommonReturnType registerUser(Users users) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 更新用户头像路径
     *
     * @param file
     * @return
     */
    @Override
    public CommonReturnType tokenUpdateUserFilePath(MultipartFile file) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 更新用户信息
     *
     * @param users
     * @return
     */
    @Override
    public CommonReturnType tokenUpdateUserInfo(Users users) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 验证用户修改密码的时候密码是否正确
     *
     * @param userPassword
     * @return
     */
    @Override
    public CommonReturnType tokenCheckUserPasswordIsOk(String userPassword) {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 退出登录
     *
     * @return
     */
    @Override
    public CommonReturnType loginOut() {
        return CommonReturnType.create("服务降级");
    }

    /**
     * 获取用户的详细信息（不包括密码）
     *
     * @param userId
     * @return
     */
    @Override
    public CommonReturnType getUserInfo(String userId) {
        return CommonReturnType.create("服务降级");
    }
}
